package com.dg11185.nearshop.net.response;


public enum NetStatus {

    SUCCESS, /**成功*/
    FAIL, /** 系统错误 */
    NOT_FOUND, /**记录不存在*/
    ILLEGAL_PAR, /** 参数异常 */
    EXCEPTION, /** webservice调用失败 */
    ILLEGAL_SIGN,/** 无效的签名 */
    NULL_STATUS, /**接口传过来的状态为空*/
    UNKNOW_ERROR, /**接口没有返回类型的错误*/
    EMPTY_DATA;
    public static NetStatus getStatus(String exception){
        if("".equals(exception) || exception==null)
            return NULL_STATUS;
        if(exception.equals("SUCCESS") || exception.equals("00000"))
            return SUCCESS;
        if(exception.equals("FAIL") || exception.equals("00001"))
            return FAIL;
        if(exception.equals("NOT_FOUND") || exception.equals("40001"))
            return NOT_FOUND;
        if(exception.equals("ILLEGAL_PAR") || exception.equals("40002"))
            return ILLEGAL_PAR;
        if(exception.equals("EXCEPTION"))
            return EXCEPTION;
        if(exception.equals("ILLEGAL_SIGN"))
            return ILLEGAL_SIGN;
        if(exception.equals("EMPTY_DATA"))
            return EMPTY_DATA;
        return UNKNOW_ERROR;
    }
}
